/*
 * RevenueSourceBO.java
 *
 * Created on March 5, 2007, 8:11 PM
 *
 * 
 */

package edu.byu.isys413.group1E.data;

/**Stores information about the Revenue Source object, which is inherited by 
 * several individual revenue sources.
 *
 * @author Travis Kulbeth
 */
public abstract class RevenueSourceBO {
    
    private String revSrcID; 
    private String description;
    private double price;
    private String type;
    boolean alreadyInDB;
    boolean isDirty;
    
    /** Returns the Revenue Source ID
     *@return revSrcID
     */
    public String getRevSrcID(){
        return this.revSrcID;
    }

    /** Sets the Revenue Source ID
     *@param revSrcID contains the id for this revenue source
     */
    public void setRevSrcID(String revSrcID){
        this.setIsDirty(true);
        this.revSrcID = revSrcID;
    }

    /** Retrieves the price of the revenue source item
     *@return price
     */
    public double getPrice(){
        return this.price;
    }

    /** Sets the price of the revenue source item
     *@param price contains the price for this revSrc
     */
    public void setPrice(double price){
        this.setIsDirty(true);
        this.price = price;
    }
    
    /** Retrieves the description of the revenue source item
     *@return description
     */
    public String getDescription(){
        return this.description;
    }
    
    /** Sets the description of the Revenue Source object
     *@param description contains the description of this revenue source
     */
    public void setDescription(String description){
        this.setIsDirty(true);
        this.description = description;
    }
 
    /** Sets the alreadyInDB variable to indicate that 
     * the information contained in this object has been stored in the database
     *@param is indicates if this object has already been saved to the db
     */
    public void setAlreadyInDB(boolean is){
        setIsDirty(true);
        this.alreadyInDB = is;
    }

    /** Returns if the information contained in this object has already been stored in the database
     *@return alreadyInDB
     */
    public boolean isAlreadyInDB(){
        return alreadyInDB;
    }

    /** Returns if information has been changed within this object
     *@return isDirty
     */
    public boolean isIsDirty() {
        return isDirty;
    }

    /** Sets the variable isDirty to indicate that some information has been modified or changed
     *in this object
     *@param isDirty indicates if data has changed
     */
    public void setIsDirty(boolean isDirty) {
        this.isDirty = isDirty;
    }  
    
    /** Retrieves the type of the revenue source requested
     *@return type
     */
    public String getType() {
        return type;
    }
    
    /** Sets the type of revenue source for this object
     *@param type contains the type of revenue source this is
     */
    public void setType(String type) {
        this.setIsDirty(true);
        this.type = type;
    }
    
    /**sets soil to true.  So now we know the object has been changed
     *
     */
    public void soil()
    {
        isDirty = true;
    }
    
    /**this is called when the object has been saved.
     *
     */
    public void clean()
    {
        isDirty = false;
    }
}
